The CRC calculation is used for error detection at data transmission. The result of a calculation returns a CRC value via the data sent (Byte). The receiver detects a faulty transmission due to the unequal CRC value. The function LGF_CalcCRC8For1Byte uses 8 bits as the generator polynomial (mask).
| LGF_CalcCRC8For1Byte (FC) | ||||||||
|---|---|---|---|---|---|---|---|---|
| Byte | initValue | Ret_Val | Byte | |||||
| Byte | mask | |||||||
| Byte | value | |||||||
| Identifier | Data type | Description |
|---|---|---|
| initValue | Byte | Start value with which the calculation is executed. If there is no need for start value - assign 16#00 |
| mask | Byte | Generator polynomial with which the calculation is executed. (Mask / CRC polynomial) |
| value | Byte | Data byte for which the CRC value will be calculated. |
| Identifier | Data type | Description |
|---|---|---|
| Ret_Val | Byte | Calculated CRC value (return value of the function). |
The function calculates the CRC value from a data byte value. The start value initValue and the generator polynomial mask can be freely selected.
mask (Polynomial) and initValue (Initial Value):| Version & Date | Change description | |
|---|---|---|
| 1.0.0 | Siemens Industry Online Support | |
| 03.07.2018 | First released version | |
| 1.0.1 | Siemens Industry Online Support | |
| 17.08.2018 | Upgrade: TIA V15 Update 2 | |
| 1.0.2 | Siemens Industry Online Support | |
| 23.11.2018 | Upgrade: TIA V15.1 | |
| 1.0.3 | Simatic Systems Support | |
| 09.10.2019 | Code refactoring, comments added | |
| 3.0.0 | Simatic Systems Support | |
| 23.04.2020 | Set version to V3.0.0, harmonize the version of the whole library | |
| 3.0.1 | Simatic Systems Support | |
| 12.11.2020 | Insert documentation Assign default start values to optional inputs - `initValue`, `mask` | |